﻿//hyh
Cn_Bus ={
	init : function(){
		if(!Jes.userSess(1)) return;//session
		this.query();
	}
	,query : function(){
		Jes.page('cnbus_query_sql',{isLoad:false});
	}
	,add : function(){
		var param = Jes.getFormValue("form1",0);
		if(!param.id){alert("至少选择一项!");return;}
		var _ids = param.id.split('_'),_busnames =param.name.split('_');
		var busid='',busname='',f=false;
		for(i=0;i<_ids.length;i++){
			if(_ids[i] =='null') continue;
			f= true;
			busid = _ids[i];
			busname = _busnames[i];
		}
		if(!f) {alert("至少选择一项!");return;}
		if(busid!=''){
			parent.Jes('busid').value= busid;
			parent.Jes('busname').innerHTML= '<b>'+busname+'</b>';
			parent.Jes.hide('jes_s_div');
		}
	}
	,addOne : function(id,name){
		parent.Jes('busid').value= id;
		parent.Jes('busname').innerHTML= '<b>'+name+'</b>';
		parent.Jes.hide('jes_s_div');
		//
	}
	,view : function(id){
		window.open('../bus/busview.html?id='+id);
	}
	,tsfCol : function(){
	}
}
